<template>
  <div class="mv">
    <div class="item" v-for="(item, index) in mvList" :key="item.id + index">
      <router-link
        :to="{ path: '/mvPlay', query: { id: item.id } }"
        class="faceImg"
      >
        <i class="iconfont icon-play"></i>
        <el-image :src="item.cover" lazy>
          <div slot="placeholder" class="image-slot">
            <i class="iconfont icon-placeholder"></i>
          </div>
        </el-image>
      </router-link>
      <div class="info">
        <router-link
          :to="{ path: '/mvPlay', query: { id: item.id } }"
          class="mv-name"
          >{{ item.name }}</router-link
        >
        <router-link
          :to="{ path: '/singer', query: { id: item.artistId } }"
          class="mv-name"
          >{{ item.artistName }}</router-link
        >
        <div class="mv-playCount">
          <i class="iconfont icon-video"></i
          >{{ $utils.formartNum(item.playCount) }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "MvList",
  props: ["mvList"],
};
</script>

<style lang="less" scoped>
.mv {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: left;
  margin: 0 -10px;
  font-size: 0;
  .item {
    flex: 30%;
    max-width: calc(100% / 5 - 20px);
    margin: 20px 10px 0;
    border-radius: 4px;

    &:hover {
      .el-image {
        transform: scale(1.1);
      }
      .icon-play {
        opacity: 1;
        transform: scale(1);
      }
    }
  }
  .faceImg {
    display: block;
    position: relative;
    width: 100%;
    height: 123px;
    overflow: hidden;
  }
  .icon-play {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    margin-top: -30px;
    font-size: 60px;
    text-align: center;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s linear;
    text-shadow: 2px 2px 10px #000;
  }
  .el-image {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    z-index: 2;
    transition: all 0.4s linear;

    /deep/ img {
      height: auto;
    }
  }
  .info {
    position: relative;
    padding: 15px 0;
    .mv-name {
      display: block;
      font-size: 14px;
    }
    .mv-author,
    .mv-playCount {
      display: block;
      line-height: 24px;
      font-size: 14px;
      color: #999;
    }

    .icon-video {
      font-size: 24px;
      color: #999;
      vertical-align: top;
    }
  }
}
</style>
